class A:
    def a(self):
        bar=1
        print(bar)

if __name__ == '__main__':
    b=getattr(A,a())